package com.example.mapper;

import com.example.entity.MriImages;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 操作mri_images相关数据接口
*/
public interface MriImagesMapper {

    /**
      * 新增
    */
    int insert(MriImages mriImages);

    /**
      * 删除
    */
    int deleteById(Integer id);

    /**
      * 修改(根据id)
    */
    int updateById(MriImages mriImages);

    /**
     * 修改(根据seed)
     */
    int updateBySeed(String seed, String label);

    /**
      * 根据ID查询
    */
    MriImages selectById(Integer id);

    /**
      * 查询所有
    */
    List<MriImages> selectAll(MriImages mriImages);

    @Select("select * from mri_images where image_name = #{originalFilename}")
    MriImages selectByFileName(String originalFilename);

    @Select("select * from mri_images where image_name = #{fileName} and user_id = #{userId}")
    MriImages selectByFileNameAndUserId(String fileName, Integer userId);
}